<template>
	<view class="my-money">
		<view class="center_balance_flex" v-for="item in list" :key="item.text" @click="toPageClick(item.page)">
			<image :src="item.img" mode=""></image>
			<text>{{ item.text }}</text>
			<image src="https://farm-city.oss-cn-hangzhou.aliyuncs.com/static/images/drop-down2.png" mode=""
				style="margin-left: auto;width: 15rpx;height: 15rpx;"></image>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				user: {},
				list: [{
						img: "https://farm-city.oss-cn-hangzhou.aliyuncs.com/static/user/fxtg.png",
						text: "分享推广",
						page: "/pages/center/qrcode"
					},
					{
						img: "https://farm-city.oss-cn-hangzhou.aliyuncs.com/static/user/tuandui.png",
						text: "团队管理",
						page: "/pages/center/team-list"
					},
					{
						img: "https://farm-city.oss-cn-hangzhou.aliyuncs.com/static/user/ydfh.png",
						text: "团队分红",
						page: "/pages/center/month-fh"
					},
					{
						img: "https://farm-city.oss-cn-hangzhou.aliyuncs.com/static/user/qgfh.png",
						text: "全国分红",
						page: "/pages/center/jq-fh"
					}
				]
			}
		},
		onShow() {
			this.get_user_info()
		},
		methods: {
			//获取用户信息
			async get_user_info() {
				if (this.user_id > 0) {
					// post请求
					const data = await this.$post('api/UserInfo')
					if (data.code == 200) {
						this.user = data.data.user
					} else {
						this.$u.toast(data.msg)
					}
					setTimeout(() => {
						uni.stopPullDownRefresh()
					}, 500)
				} else {
					setTimeout(() => {
						uni.stopPullDownRefresh()
					}, 500)
				}
				this.$post('api/config')
			},
			//跳转到资金明细
			toPageClick(page) {
				console.log(page, '1212');
				uni.navigateTo({
					url: page
				})
			}
		}
	}
</script>

<style scoped lang="scss">
	.my-money {
		width: 95%;
		margin: 20rpx auto;

		.center_balance_flex {
			width: 100%;
			padding: 30rpx;
			background: #fff;
			border-radius: 20rpx;
			box-sizing: border-box;
			display: flex;
			align-items: center;
			margin-bottom: 20rpx;;
			font-size: 30rpx;
			image {
				width: 40rpx;
				height: 40rpx;
				margin-right: 20rpx;
			}
		}

		.center_balance_flex:last-child {
			border: 0;
		}
	}
</style>